# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: zccrs <zhangjide@deepin.org>

pkgname=dtkdeclarative
pkgver=5.6.19
pkgrel=1
pkgdesc='Deepin Toolkit, declarative module for DDE look and feel'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/dtkdeclarative"
license=('LGPL3')
depends=('dtkgui' 'dtkcore' 'qt5-declarative' 'qt5-quickcontrols2' 'qt5-base' 'libglvnd' 'gcc-libs')
makedepends=('cmake' 'ninja' 'qt5-tools' 'doxygen' 'gtest' 'gmock')
source=("https://github.com/linuxdeepin/dtkdeclarative/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('71bb00afc5a33ef59e3cecbc7940e5217c3c30d83220cc322facc9180e955393da48c53d9fd48b2773e0b61ea4b8a1912bb457fa8a6739b7c39952e18e7c76d9')

build() {
  cd $pkgname-$pkgver
  cmake . -GNinja \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DQML_INSTALL_DIR=lib/qt/qml \
    -DDTK_VERSION=$pkgver \
    -DBUILD_DOCS=ON \
    -DQCH_INSTALL_DESTINATION=share/doc/qt
  ninja
}

check() {
  cd $pkgname-$pkgver
  # ninja test
}

package() {
  cd $pkgname-$pkgver
  DESTDIR="$pkgdir" ninja install
}
